package cn.edu.seig.textbook.controller;


import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author day
 * @since 2024-11-07
 */


@RestController
@RequestMapping("/permissions")
public class PermissionsController {

    // 获取所有权限
    @GetMapping
    public String getAllPermissions() {
        return "Get all permissions";
    }

    // 根据ID获取权限
    @GetMapping("/{id}")
    public String getPermissionById(@PathVariable String id) {
        return "Get permission by ID: " + id;
    }

    // 创建新权限
    @PostMapping
    public String createPermission(@RequestBody String permissionData) {
        return "Create permission with data: " + permissionData;
    }

    // 更新权限
    @PutMapping("/{id}")
    public String updatePermission(@PathVariable String id, @RequestBody String permissionData) {
        return "Update permission with ID: " + id + " and data: " + permissionData;
    }

    // 删除权限
    @DeleteMapping("/{id}")
    public String deletePermission(@PathVariable String id) {
        return "Delete permission with ID: " + id;
    }
}
